<?php

/**
 * Description of guestCancelAction
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 */

class guestCancelAction extends sfAction {
    
    public function execute($request) {
        $token = $request->getParameter('token');
        
        SqlEngineCore::get()->update(
                    array('table' => 'reservation',
                          'columns' => array(
                                'deleted_at' => 'NOW()'),
                          'where' => array(
                                'token' => $token)));
        
        $reservation = SqlEngine::getReservations(array('token' => $token));
        
        Util::send_cancellation_email($reservation[0]);
    }
}
